//必须带done回调 执行完成调用
import { ElMessage } from 'element-plus'
import { translateTitle } from '@/utils/i18n'
export default function filterTreeNode({ vm, action, done, callbackData }) {
  // console.log('vm', vm, action)
  let treeId = action.extension.treeId.value && action.extension.treeId.value[0]
  const filterContent = action.extension.filterContent && action.extension.filterContent.value
  if (treeId) {
    if (treeId.indexOf('uiTree') > -1) {
      let _tree = vm.vuiComponents[treeId]
      _tree && _tree.self.runFilterNode(callbackData[filterContent])
    } else {
      ElMessage({
        showClose: true,
        message: translateTitle('Ve.eventTask.筛选树节点'),
        type: 'error',
      })
    }
  }
  done(null, {})
}
